{
  "properties" : { },
  "id" : "d04d2190376543a292840a069120d4db",
  "script" : null,
  "groupId" : "72aa006ebd6a4c1183b8f202a668e130",
  "name" : "03.活动查询接口",
  "createTime" : 1752159769675,
  "updateTime" : 1752161753617,
  "lock" : null,
  "createBy" : null,
  "updateBy" : null,
  "path" : "/activityQuery",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "{\"activityReq\":{\"poolId\":1},\"q\":\"\",\"current\":1,\"size\":20}",
  "headers" : [ {
    "name" : "Token",
    "value" : "782eb501-08f7-461e-8255-df6632c28f01",
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 200,\n    \"message\": \"success\",\n    \"data\": {\n        \"list\": [\n            {\n                \"title\": \"运动腕表大牌购\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/VhC7iVxXHxx1JPtmNzNLjw3NKHu/index.html\",\n                \"advantage\": \"国补再减15% 不止5折\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/305992/28/16515/317010/686dfa29F909b9e86/0575039149e3f1ad.png\"\n            },\n            {\n                \"title\": \"男士理容甄选\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/jNy7VKeQqjToDhQDtpYxRhXheRm/index.html\",\n                \"advantage\": \"爆款直降 一剃净爽\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/307221/31/15950/219134/686f2665F9c5b0e7b/8ecbae373885de3f.png\"\n            },\n            {\n                \"title\": \"雅赞溯源直播\",\n                \"urlPC\": \"https://mall.jd.com/index-1000562963.html\",\n                \"advantage\": \"PLUS专享低价\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/302538/26/20131/164863/686f50bcFa8881d16/67688321f9e49c6b.png\"\n            },\n            {\n                \"title\": \"雷鸟电视专区\",\n                \"urlPC\": \"https://mall.jd.com/index-1000335108.html?from=pc\",\n                \"advantage\": \"至高享免费安装\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/317359/4/14753/260712/686e0772Fa068ebc3/8cc8d493de50d56e.png\"\n            },\n            {\n                \"title\": \"范思哲腕表联合活动\",\n                \"urlPC\": \"https://mall.jd.com/index-1000337405.html\",\n                \"advantage\": \"全场低至3折\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/298867/28/21612/176482/686cff5bF3398faed/d1dfcae1fd93379f.png\"\n            },\n            {\n                \"title\": \"厨房小家电清凉饮品季\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/4UNioWhCyvBrRH6Az6pYn3W16v22/index.html?babelChannel=ttt25\",\n                \"advantage\": \"爆品低至5折\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/312302/39/15661/228472/686e0b43Ff73aadb3/2054b1ea9dfeda3c.png\"\n            },\n            {\n                \"title\": \"酷开焕新钜惠\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/Fp5Sk4BfUe22FYuHzo9j6CrMgps/index.html\",\n                \"advantage\": \"叠加国补不止8折\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/293065/20/18710/270591/686e0053Ff2664658/a9884a1cea208f73.png\"\n            },\n            {\n                \"title\": \"按摩椅开启宅家养生\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/2QxU1ocbtZ8ewX46TF8dLYCeC2yt/index.html\",\n                \"advantage\": \"至高享7折\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/316198/25/14998/184901/686b778fF9158e691/2de5fde774c85426.png\"\n            },\n            {\n                \"title\": \"金榜题名香皂礼盒\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/3Rs6hucaQkTxRjZXC9iDHJSVXaWw/index.html?babelChannel=ttt33\",\n                \"advantage\": \"限时49.9，升学宴好物\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/311500/4/15166/263136/686cf778F3ec29131/e48167682c7e1f89.png\"\n            },\n            {\n                \"title\": \"冰淇淋大世界清凉季\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/3M6DMCsEVxnoEwyBeKnhXnDaMjhm/index.html?babelChannel=ttt3\",\n                \"advantage\": \"满199减100\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/287716/33/15868/342856/686ceadcF4792f32a/c4fdfe85ca9d9904.png\"\n            },\n            {\n                \"title\": \"小家焕新季\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/3KyKK2KH7FBmGCdtJeergBdFgUM7/index.html?babelChannel=ttt2\",\n                \"advantage\": \"全周期满199减20元\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/319277/30/14457/232479/686ce68fFa8dcd080/be860adac44357b9.png\"\n            },\n            {\n                \"title\": \"五金城清凉季\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/3FsEFcsoSNK2Ev8QNu7VzwAHzor8/index.html?babelChannel=ttt11\",\n                \"advantage\": \"每满300减30\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/289196/34/13594/150602/686cadf2Fb7467ef6/f40ca45b375c9f5d.png\"\n            },\n            {\n                \"title\": \"多芬发膜\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/3wEacw67Yyg6UYQJmvnLoRsbM4cg/index.html\",\n                \"advantage\": \"买赠好礼\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/289886/2/13983/235681/686b7961Ff26813aa/d5c97ddabeccaf6b.png\"\n            },\n            {\n                \"title\": \"清扬男士\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/reitrMtjNtHDsRvkyJPDG4haUkj/index.html\",\n                \"advantage\": \"爆款热卖\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/305869/33/15157/322262/6864ea86F95525a0e/2977737cdda49126.png\"\n            },\n            {\n                \"title\": \"鲜花园艺清凉季\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/2qSteu2qyZhMWfB9UT3PRQCzopsK/index.html?babelChannel=ttt15\",\n                \"advantage\": \"满99打9折\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/300782/17/11372/142708/686b32adFe91b2cf4/9c87377b3a28a2a4.png\"\n            },\n            {\n                \"title\": \"习酒京韵\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/2YL1s7TvZVvDybiPsWfgD3RXa8qw/index.html\",\n                \"advantage\": \"京东PLUS会员立享95折\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/298585/39/18774/218670/6867614aFe4f4fb14/9abce2ef039e9f69.png\"\n            },\n            {\n                \"title\": \"7月泳装节\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/3gHQkAG2WCySGLFtACcuQYP1tMcR/index.html\",\n                \"advantage\": \"满159减40\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/290319/21/14379/271764/68676745Fb13dc782/f8192cb38a90716e.png\"\n            },\n            {\n                \"title\": \"海尔洗衣机会场\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/36WmtJMTJpW3if3qQrdG5cuXRHgC/index.html\",\n                \"advantage\": \"国家补贴至高享8折\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/312584/21/14415/325716/6867aba3Fcdce8893/daa9cbdd6abc59a3.png\"\n            },\n            {\n                \"title\": \"教辅暑假季\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/48icPGhZHGhnAZC2hty8shm497nj/index.html\",\n                \"advantage\": \"满100减30\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/316289/39/12895/314552/685e6393F037de8c9/ddb2098589dc373a.png\"\n            },\n            {\n                \"title\": \"人文社科暑促会场\",\n                \"urlPC\": \"https://pro.jd.com/mall/active/24MS9SnQQki4emdvCCaeFwq2tmuQ/index.html\",\n                \"advantage\": \"满100减30\",\n                \"imgUrl\": \"https://img14.360buyimg.com/pop/jfs/t1/311910/22/14531/267586/68676ed0F52394d80/5a1f944f24f3e748.png\"\n            }\n        ],\n        \"total\": 51\n    },\n    \"timestamp\": 1752161195745,\n    \"executeTime\": 566\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : null,
    "defaultValue" : null,
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "code",
      "value" : "402",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "message",
      "value" : "凭证已过期",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "null",
      "description" : "",
      "required" : false,
      "dataType" : "Object",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "timestamp",
      "value" : "1734365046744",
      "description" : "",
      "required" : false,
      "dataType" : "Long",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "executeTime",
      "value" : "null",
      "description" : "",
      "required" : false,
      "dataType" : "Object",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
import jd;    //导入jd模块
import cn.hutool.core.date.DateUtil;

var params =  {
    apiMethodName:"jd.union.open.activity.query"
    };
if(body!=null){
    params.putAll(body);
}

params.activityReq.pageIndex= body.current;
params.activityReq.pageSize = body.size;
params.activityReq.activeDate = DateUtil.today().replace("-", "");

var response = jd.execute(params);
if(response.queryResult!=null && response.queryResult.code!=200 ) {
    exit 500,response.queryResult.message;
}

var list = [];

response.queryResult.data.each(it => {

   var map = {};
   map.put("title",it.title);
   map.put("urlPC",it.urlPC);
   map.put("advantage",it.advantage);
   map.put("startTime",it.startTime);
   map.put("endTime",it.endTime);
   map.put("tag",it.tag);
   map.put("actStatus",it.actStatus);
   map.put("imgUrl",it.imgList[0].imgUrl);
   
   list.add(map);

})

return {list:list,total:response.queryResult.totalCount};
